﻿<Window x:Class="WpfAppWcfRestConsumer.WindowJsonResponse"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WindowJsonResponse" Height="300" Width="300" Loaded="Window_Loaded">
    <Grid>
		
		<Grid.RowDefinitions>
			<RowDefinition Height="200"/>
			<RowDefinition />
		</Grid.RowDefinitions>
		<ListBox x:Name="lstPersons" ItemsSource="{Binding}" Grid.Column="1" SelectionChanged="lstPersons_SelectionChanged">
			<ListBox.ItemTemplate>
				<DataTemplate>
					<StackPanel>
						<TextBlock Text="{Binding Name}"/>
						<TextBlock Text="{Binding LastName}"/>
					</StackPanel>
				</DataTemplate>
			</ListBox.ItemTemplate>
			<ListBox.ContextMenu>
				<ContextMenu x:Name="PersonsContextMenu">
					<Separator/>
					<MenuItem x:Name="miDeletePerson" Header=" Delete person" Click="miDeletePerson_Click"/>
				</ContextMenu>
			</ListBox.ContextMenu>
		</ListBox>
		
		<StackPanel Grid.Row="1" Orientation="Horizontal">
			<Button x:Name="btnAdd" Content="Add person" Click="btnAdd_Click"/>
			<Button x:Name="btnView" Content="Shaow all person" Click="btnView_Click"/>
		</StackPanel>
	</Grid>
</Window>
